import Vue from "vue";
import Vuex from "vuex";

//1.应用Vuex
Vue.use(Vuex);

//2.实例化Vuex仓库
const store = new Vuex.Store({
  state: {
    num: 4,
  },

  getters: {
    doubleNum(state) {
      return state.num * 2;
    },
  },
});

//3.暴露store给入口文件
export default store;
